//
//  SEProfileOrderCell.swift
//  SmartEyeForPatient
//
//  Created by qdsg on 2021/4/13.
//

import UIKit

enum SEProfileOrderCellActionType {
    case hospitalize
    case examination
    case prescription
}

protocol SEProfileOrderCellDelegate: NSObjectProtocol {
    func profileOrderCellTapAction(type: SEProfileOrderCellActionType)
}

class SEProfileOrderCell: UITableViewCell {

    static let className = "SEProfileOrderCell"
    static let reuseId = className

    weak var delegate: SEProfileOrderCellDelegate?
    
    @IBOutlet weak var bgView: UIView! {
        didSet {
            bgView.setLayerCorners(rect: bgView.bounds, radius: 14)
            bgView.setShadow()
        }
    }

    @IBAction func hospitalizeBtnAction(_ sender: UIButton) {
        delegate?.profileOrderCellTapAction(type: .hospitalize)
    }

    @IBAction func examineBtnAction(_ sender: UIButton) {
        delegate?.profileOrderCellTapAction(type: .examination)
    }

    @IBAction func prescriptionBtnAction(_ sender: UIButton) {
        delegate?.profileOrderCellTapAction(type: .prescription)
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
